package com.ktjiaoyu.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ktjiaoyu.crm.pojo.Role;
import com.ktjiaoyu.crm.pojo.RoleRight;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * @InterfaceName : RoleRightMapper
 * @Description :
 * @Author : Lzz
 * @Date: 2023/12/6 09:51:44
 */
public interface RoleRightMapper extends BaseMapper<RoleRight> {

    @Insert("<script>"+
            "insert into sys_role_right(rf_role_id,rf_right_code) values"+
            "<foreach collection='rightCodes' item='rightCode' separator=','>"+
            "(#{role.roleId},#{rightCode})"+
            "</foreach>"+
            "</script>")
    boolean saveRoleRight(@Param("role") Role role, @Param("rightCodes")String[] rightCodes);

}
